package com.example.mybatis_test.service.impl;

import com.example.mybatis_test.entity.tea.Tea;
import com.example.mybatis_test.entity.tea.vo.QueryTeaStuJoinVo;
import com.example.mybatis_test.entity.tea.vo.QueryTeaStuVo;
import com.example.mybatis_test.mapper.TeaMapper;
import com.example.mybatis_test.service.TeaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mybatis_test.util.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ican
 * @since 2023-06-08
 */
@Service
public class TeaServiceImpl extends ServiceImpl<TeaMapper, Tea> implements TeaService {

    @Resource
    private TeaMapper teaMapper;

    @Override
    public R selectTeaStuList(Integer teaId) {
        List<QueryTeaStuVo> list = teaMapper.selectTeaUserList(teaId);
        return R.ok("查询成功").put("list",list);
    }

    @Override
    public R selectTeaJoinStuList(Integer teaId) {
        List<QueryTeaStuJoinVo> list = teaMapper.selectTeaJoinStuList(teaId);
        return R.ok("查询成功").put("list",list);
    }
}
